/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hibernate.model.dao;

import hibernate.pojo.Loaithanhtoan;
import hibernate.util.HibernateUtil;
import org.hibernate.HibernateException;
import org.hibernate.Session;

/**
 *
 * @author phathuynh
 */
public class LoaiThanhToanDAO {
    //<editor-fold defaultstate="collapsed" desc="1. Lấy loại thanh toán">
    public static Loaithanhtoan layLoaiThanhToan(int orderTypeID){
        Loaithanhtoan orderType = null;
        Session session = HibernateUtil.getSessionFactory().openSession();
        try{
            orderType = (Loaithanhtoan) session.get(Loaithanhtoan.class, orderTypeID);
        }catch(HibernateException hex){
            System.err.print(hex);
        }finally{
            session.close();
        }
        return orderType;
    }
    
    //</editor-fold>
    
    
    
    //</editor-fold>
}
